package com.xyy.saas.payment.dao.mapper;

import com.xyy.saas.payment.dao.model.WithdrawOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author wangtianqi
 */
@Mapper
public interface WithdrawOrderMapper {
    int deleteByPrimaryKey(Long id);

    int insert(WithdrawOrder record);

    int insertSelective(WithdrawOrder record);

    WithdrawOrder selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(WithdrawOrder record);

    int updateByPrimaryKey(WithdrawOrder record);

    WithdrawOrder selectByChannelWithdrawNo(String channelWithdrawNo);

    WithdrawOrder selectByWithdrawNo(String withdrawNo);

    List<WithdrawOrder> selectByUserIdAndCondition(@Param("userId")String userId, @Param("page")int page,  @Param("pageSize")int pageSize);

    int selectCountByUserIdAndCondition(@Param("userId")String userId);

    WithdrawOrder selectByBusinessWithdrawNo(@Param("businessType") String businessType,@Param("businessWithdrawNo")String businessWithdrawNo);

    List<WithdrawOrder> selectListByStatusAndPayChannel(@Param("channel")String channel, @Param("status")Byte status, @Param("pageOffset")Integer pageOffset, @Param("pageSize")Integer pageSize);

    Long queryWithdrawAmount(@Param("userId") String userId, @Param("beginTime") LocalDateTime beginTime, @Param("endTime") LocalDateTime endTime);

}